package com.deep.rocket.producer.message;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.stereotype.Service;

@Service
public class ReceiveService {

    /**
     * spring cloud stream里面通过 Sink 接收消息
     */
    @Autowired
    private Sink sink;

    @StreamListener(value = Sink.INPUT)
    public void getListener(String message) {
        System.out.println("test-group=" + message);
    }
}